/*     */ package btsm.servlet;
/*     */ 
/*     */ import btsm.bean.sqlUsersWork;
/*     */ import java.io.IOException;
/*     */ import javax.servlet.RequestDispatcher;
/*     */ import javax.servlet.ServletException;
/*     */ import javax.servlet.http.HttpServlet;
/*     */ import javax.servlet.http.HttpServletRequest;
/*     */ import javax.servlet.http.HttpServletResponse;
/*     */ 
/*     */ public class ser_users extends HttpServlet
/*     */ {
/*     */   public void init()
/*     */     throws ServletException
/*     */   {
/*     */   }
/*     */ 
/*     */   public void doGet(HttpServletRequest request, HttpServletResponse response)
/*     */     throws ServletException, IOException
/*     */   {
/*  23 */     sqlUsersWork PC = new sqlUsersWork("Users", "");
/*     */ 
/*  25 */     String seraction = request.getParameter("seraction");
/*     */ 
/*  27 */     String strsnid = request.getParameter("snid");
/*  28 */     String filesnames = request.getParameter("filesnames");
/*     */ 
/*  30 */     String msg = "";
/*     */ 
/*  32 */     String strRedURL = "common.jsp";
/*     */ 
/*  36 */     if (seraction.equals("seradd")) {
/*  37 */       String[] fieldxg = request.getParameterValues("T1");
/*  38 */       strsnid = fieldxg[0];
/*     */ 
/*  40 */       if (PC.add(fieldxg))
/*  41 */         msg = "新建用户成功";
/*     */       else
/*  43 */         msg = "新建用户失败";
/*     */     }
/*  45 */     else if (seraction.equals("sermodp"))
/*     */     {
/*  47 */       request.setAttribute("snid", strsnid);
/*  48 */       filesnames = filesnames.replaceAll("list", "md");
/*  49 */       strRedURL = "nnmd_users.jsp";
/*  50 */     } else if (seraction.equals("serdel")) {
/*  51 */       PC.wheresw = strsnid;
/*  52 */       if (PC.del())
/*  53 */         msg = "用户信息删除成功";
/*     */       else
/*  55 */         msg = "用户信息删除失败";
/*     */     }
/*  57 */     else if (seraction.equals("sermod"))
/*     */     {
/*  59 */       String[] fieldxg = request.getParameterValues("T1");
/*     */ 
/*  61 */       PC.wheresw = fieldxg[0];
/*  62 */       strsnid = fieldxg[0];
/*  63 */       filesnames = filesnames.replaceAll("list", "md");
/*     */ 
/*  65 */       boolean result = PC.md(fieldxg);
/*  66 */       if (result)
/*  67 */         msg = "用户信息修改成功";
/*     */       else {
/*  69 */         msg = "用户信息修改失败";
/*     */       }
/*     */     }
/*  72 */     else if (seraction.equals("serPerInfoSetS"))
/*     */     {
/*  74 */       String[] fieldxg = request.getParameterValues("T1");
/*  75 */       PC.wheresw = fieldxg[0];
/*  76 */       strsnid = fieldxg[0];
/*     */ 
/*  78 */       if (PC.mdUserSet(fieldxg))
/*  79 */         msg = msg + "用户信息修改成功";
/*     */       else
/*  81 */         msg = msg + "用户信息修改失败";
/*     */     }
/*  83 */     else if (seraction.equals("serpwdset")) {
/*  84 */       String[] fieldxg = request.getParameterValues("T1");
/*     */ 
/*  86 */       PC.wheresw = fieldxg[0];
/*  87 */       strsnid = fieldxg[0];
/*  88 */       if (PC.mdPasswd(fieldxg[0], fieldxg[2]))
/*  89 */         msg = msg + "修改密码成功";
/*     */       else {
/*  91 */         msg = msg + "修改密码失败";
/*     */       }
/*     */     }
/*     */ 
/*  95 */     PC.dbConClose();
/*  96 */     String filesnamesmd = "ser_users?seraction=sermodp&snid=" + strsnid + "&filesnames=" + filesnames;
/*  97 */     request.setAttribute("filesnames", filesnamesmd);
/*  98 */     request.setAttribute("msg", msg);
/*  99 */     RequestDispatcher btsm = request.getRequestDispatcher(strRedURL);
/* 100 */     btsm.forward(request, response);
/*     */   }
/*     */ 
/*     */   public void doPost(HttpServletRequest request, HttpServletResponse response)
/*     */     throws ServletException, IOException
/*     */   {
/* 106 */     doGet(request, response);
/*     */   }
/*     */ 
/*     */   public void destroy()
/*     */   {
/*     */   }
/*     */ }

/* Location:           E:\java\apache-tomcat-6.0.36\webapps\btsm\WEB-INF\classes\
 * Qualified Name:     btsm.servlet.ser_users
 * JD-Core Version:    0.6.2
 */